//
//  ViewController.m
//  CardMoveGame
//
//  Created by peac on 2025/11/5.
//

#import "ViewController.h"
#import "GameViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIImageView *drawbgIv=[[UIImageView alloc]initWithFrame:self.view.bounds];
    drawbgIv.contentMode = UIViewContentModeScaleAspectFill;
    drawbgIv.image=[UIImage imageNamed:@"bj"];
    [self.view addSubview:drawbgIv];
    
    UIButton *gmaeBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    gmaeBtn.frame=CGRectMake(self.view.frame.size.width/2-10-self.view.frame.size.height*0.138*0.7, self.view.frame.size.height*0.15, self.view.frame.size.height*0.138*1.4, self.view.frame.size.height*0.138*0.7);
    [gmaeBtn setBackgroundImage:[UIImage imageNamed:@"Card-Defender"] forState:UIControlStateNormal];
    [self.view addSubview:gmaeBtn];
    [gmaeBtn addTarget:self action:@selector(gamebtnclicked) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *challengeBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    challengeBtn.frame=CGRectMake(self.view.frame.size.width/2-10-self.view.frame.size.height*0.138*0.7, self.view.frame.size.height*0.28, self.view.frame.size.height*0.138*1.4, self.view.frame.size.height*0.138*0.7);
    [challengeBtn setBackgroundImage:[UIImage imageNamed:@"Challenge"] forState:UIControlStateNormal];
    [self.view addSubview:challengeBtn];
    [challengeBtn addTarget:self action:@selector(challengebtnclicked) forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView *charactor = [[UIImageView alloc] init];
    charactor.frame=CGRectMake(self.view.frame.size.width/2-10-self.view.frame.size.height*0.138*0.7, self.view.frame.size.height*0.28, self.view.frame.size.height*0.138*1.4, self.view.frame.size.height*0.138*0.7);
    [charactor setImage:[UIImage imageNamed:@"Challenge"]];
    [self.view addSubview:charactor];
}

-(void)gamebtnclicked{
    if (self.pushdelegate) {
        [_pushdelegate centerViewControllerDidmagicshotPush];
    }
    
//    GameViewController *mdlgVc=[[GameViewController alloc]init];
//    mdlgVc.view.backgroundColor = [UIColor clearColor];
////    mdlgVc.modalPresentationStyle=UIModalPresentationFullScreen;
//    mdlgVc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
//    mdlgVc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
//    [self presentViewController:mdlgVc animated:NO completion:nil];
}

-(void)challengebtnclicked
{
    
}
@end
